home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group00a.txt / 000056_icon-group-sender _Mon Apr 10 10:14:32 2000.msg < prev    next >
Internet Message Format  |  2001-01-03  |  2KB

  1. Return-Path: <icon-group-sender>
  2. Received: (from root@localhost)
  3.     by baskerville.CS.Arizona.EDU (8.9.1a/8.9.1) id KAA11146
  4.     for icon-group-addresses; Mon, 10 Apr 2000 10:14:24 -0700 (MST)
  5. Message-Id: <200004101714.KAA11146@baskerville.CS.Arizona.EDU>
  6. Date: Mon, 10 Apr 2000 09:48:05 -0700
  7. From: Steve Wampler <swampler@noao.edu>
  8. X-Accept-Language: en
  9. To: "Udut, Kenneth" <kenneth.udut@spcorp.com>,
  10.         icon-group <icon-group@optima.CS.Arizona.EDU>
  11. Subject: Re: s1 ~=== s2  :  s2
  12. Errors-To: icon-group-errors@optima.CS.Arizona.EDU
  13. Status: RO
  14.  
  15. "Udut, Kenneth" wrote:
  16. > My question:
  17. > >From the helpfile:
  18. > s1 ~=== s2 : s2 -- compare values
  19. > x1 ~=== x2 produces the value of x2
  20. > if x1 and x2 do not have the same value, but fails otherwise.
  21. > Now - I'm wondering, is this the same
  22. > as saying in BASIC:
  23. > PROCEDURE COMPARE()
  24. >         A$=""
  25. >         IF X$ <> Y$, THEN LET A$=Y$
  26. > END
  27. > Or, one of my favorite little formulas in
  28. > Excel:
  29. > =if(a2=a1,"",a2)
  30. > Is the
  31. > s1 ~=== s2: s2
  32. > the same as that Excel function or that visual basic procedure?
  33. > -Kenneth
  34.  
  35. No.  Also, carefully consider the differences in Icon between == (~==) and
  36. === (~===).  It's unlikely that ~=== is equivalent to <> in BASIC.
  37.  
  38. However, s1 ~== s2 is very close to both of the above. (I assume that
  39. A$ gets returned by the COMPARE procedure in BASIC?)
  40.  
  41. The fundamental difference is on expression failure (not a concept in
  42. either BASIC or excel, hence the difficulty in mapping).
  43.  
  44. For example, to match the excel expression, you'd need:
  45.  
  46.     (s1 ~== s2) | ""
  47.  
  48. though you probably don't want to produce an exact match anyway, as that
  49. takes away the advantages offered by having expressions succeed or fail.
  50.  
  51. --
  52. Steve Wampler-  SOLIS Project, National Solar Observatory
  53. swampler@noao.edu
  54.